Skip to content

Conversation

@RahulKrishna145
Copy link

Pull request type

  • Code changes (bugfix, features)
  • Code maintenance (refactoring, formatting, tests)
  • ReadMe, Docs and GitHub updates
  • Other (please describe):

Checklist

  • Tests for the changes have been added (if needed)
  • Docs have been reviewed and added / updated
  • Lint (black rocketpy/ tests/) has passed locally
  • All tests (pytest tests -m slow --runslow) have passed locally

Current behavior

here, air brakes controller doesn't pass environment as parameter but uses the global variables.

New behavior

Now, air brakes controller uses env parameter, you can use the file "test_environment_parameter.py" to check functioning.

Breaking change

  • No

Additional information

Enter text here...

@Gui-FernandesBR
Copy link
Member

@MateusStano could you review this one please?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR solves the issue where air brake controllers relied on global environment variables by adding an environment parameter to the controller function signature. This enables local access to atmospheric conditions without using global variables.

  • Added environment parameter support to controller functions (6, 7, or 8 parameters now supported)
  • Updated controller initialization to handle the new environment parameter with backward compatibility
  • Created test fixtures and standalone test script to demonstrate the new functionality

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/fixtures/function/function_fixtures.py Added new test fixture demonstrating environment parameter usage in controller
test_environment_parameter.py Standalone test script showing different controller signatures and environment usage
rocketpy/simulation/flight.py Updated simulation to pass environment parameter to controllers
rocketpy/rocket/rocket.py Updated documentation to describe the new environment parameter
rocketpy/control/controller.py Enhanced controller initialization to support 8-parameter functions and updated call signature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@codecov
Copy link

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.37%. Comparing base (9cf3dd4) to head (fc10614).
⚠️ Report is 12 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #854      +/-   ##
===========================================
+ Coverage    80.27%   80.37%   +0.10%     
===========================================
  Files          104      106       +2     
  Lines        12769    13013     +244     
===========================================
+ Hits         10250    10459     +209     
- Misses        2519     2554      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gui-FernandesBR Gui-FernandesBR changed the title solved environment parameter global usage, now can be used locally. ENH: Air brakes controller functions now support 8-parameter signature Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

ENH: introduce "env" argument to airbrakes controllers

4 participants